package com.webtaglib.tags;

import java.io.IOException;

import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.tagext.BodyTagSupport;

import com.tools.StringUtil;

public class FilterHtmlTag extends BodyTagSupport {

	private static final long serialVersionUID = 1851111848173151916L;
	
	public int doAfterBodyTag() throws JspTagException{
		BodyContent bc=getBodyContent();
		String input=bc.getString();
		JspWriter out=bc.getEnclosingWriter();
		
		String newContent=StringUtil.filterHtml(input);
		try {
			out.println(newContent);
		} catch (IOException e) {
			throw new JspTagException(e);
		}
		return SKIP_BODY;
	}
}




